#! /bin/bash

# 更新源

sudo yum update
sudo yum upgrape

## 安装依赖
sudo yum install libXt-devel gtk2-devel
sudo yum -y install python-devel ruby ruby-devel perl perl-devel perl-ExtUtils-Embed
sudo yum install ncurses-devel
sudo yum install ctags

##源码编译安装python3
## 安装python依赖
sudo yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel libffi-devel

## 下载Python-3.7.3.tgz
sudo yum -y install wget
#wget https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tgz
tar -zxvf Python-3.7.3.tgz
cd Python-3.7.3
./configure --prefix=/usr/local/python3 --enable-shared
make
sudo make install
cp libpython3.7m.so.1.0  /usr/lib64

## 建立软连接
sudo ln -s /usr/local/python3/bin/python3.7 /usr/bin/python3
sudo ln -s /usr/local/python3/bin/pip3.7 /usr/bin/pip3

# 编译安装vim
git clone https://github.com/vim/vim.git
cd vim
./configure --disable-selinux --enable-perlinterp=yes --enable-python3interp=yes --with-python-config-dir=/usr/local/python3/lib/python3.7/config-3.7m-x86_64-linux-gnu --enable-rubyinterp=yes --enable-cscope --enable-gui=auto --with-features=huge --enable-multibyte --enable-xim --with-x --with-gnome --with-compiledby="Steven Zhang" --prefix=/usr/local/vim8
make
sudo make install
